﻿using System;
using System.Collections.Generic;
using System.Windows.Data;
using System.Globalization;
using Asistente.Model.Representation;

namespace Asistente.Converters
{
    class AddDataGroupToControlEnabledConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                Control ctrl =(Control) value;
                ControlPattern ctrlPattern = ctrl.ControlPattern;
                if ((ctrlPattern == ControlPattern.Autocomplete) || (ctrlPattern == ControlPattern.DropDownChooser) || (ctrlPattern == ControlPattern.CalculatedField))
                {
                    return true;
                }
            }
            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
